PRINT "Use 1st letter of any item or "; CHR$(24); " "; CHR$(25); " "; CHR$(26); " "; CHR$(27); " to highlight selection, then press "; CHR$(17) + CHR$(196) + CHR$(217); 'PICTURE OF CR
VN = UBOUND(VAR$, 1)
VM = UBOUND(HELP$, 1)
HN = UBOUND(VAR$, 2)
HM = UBOUND(HELP$, 2)
REDIM COLPOS(HN)
LOCATE ROW%, COL%
FOR J = 1 TO VN
LOCATE ROW% + VSPACING% * (J - 1), COL%
FOR I = 1 TO HN
IF I = 1 AND J = 1 THEN
HOR = 1
VERT = 1
GOSUB HELPH
COLOR HLFG%, HLBG%
ELSE
COLOR FG%, BG%
END IF
IF J = 1 THEN COLPOS(I) = POS(0)
PRINT VAR$(J, I);
IF I < HN THEN
COLOR FG%, BG%
LOCATE , POS(0) + HSPACING%
END IF
NEXT I
NEXT J
LOCATE ROW%, COL%
VERT = 1
HOR = 1
140 I$ = INKEY$: IF I$ = "" THEN 140
IA = ASC(RIGHT$(I$, 1))
L = LEN(I$)
IF L = 2 AND IA = 77 THEN ' RIGHT ARROW
COLOR FG%, BG%
IND = 0
DO
IND = IND + 1
LOOP UNTIL POS(0) = COLPOS(IND)
PRINT VAR$(VERT, IND);
IF IND < HN THEN
LOCATE , POS(0) + HSPACING%
COLOR HLFG%, HLBG%
PRINT VAR$(VERT, IND + 1);
HOR = IND + 1
ELSE
LOCATE , COL%
COLOR HLFG%, HLBG%
PRINT VAR$(VERT, 1);
HOR = 1
END IF
LOCATE , COLPOS(HOR)
GOSUB HELPH
END IF
IF L = 2 AND IA = 75 THEN ' LEFT ARROW
COLOR FG%, BG%
IND = 0
DO
IND = IND + 1
LOOP UNTIL POS(0) = COLPOS(IND)
PRINT VAR$(VERT, IND);
IF IND > 1 THEN
COLOR HLFG%, HLBG%
LOCATE , COLPOS(IND - 1)
PRINT VAR$(VERT, IND - 1);
HOR = IND - 1
ELSE
LOCATE , COLPOS(HN)
COLOR HLFG%, HLBG%
PRINT VAR$(VERT, HN);
HOR = HN
END IF
LOCATE , COLPOS(HOR)
GOSUB HELPH
END IF
HKOL = COLPOS(HOR)
IF L = 2 AND IA = 80 THEN ' DOWN ARROW
COLOR FG%, BG%
RO = CSRLIN
IND = (RO - ROW%) \ VSPACING% + 1
LOCATE RO, HKOL
PRINT VAR$(IND, HOR);
COLOR HLFG%, HLBG%
IF IND < VN THEN
LOCATE RO + VSPACING%, HKOL
PRINT VAR$(IND + 1, HOR);
LOCATE RO + VSPACING%, HKOL
VERT = IND + 1
ELSE
LOCATE ROW%, HKOL
PRINT VAR$(1, HOR);
LOCATE ROW%, HKOL
VERT = 1
END IF
GOSUB HELPH
END IF
IF L = 2 AND IA = 72 THEN ' UP ARROW
COLOR FG%, BG%
RO = CSRLIN
IND = (RO - ROW%) \ VSPACING% + 1
LOCATE RO, HKOL
PRINT VAR$(IND, HOR);
COLOR HLFG%, HLBG%
IF IND > 1 THEN
LOCATE RO - VSPACING%, HKOL
PRINT VAR$(IND - 1, HOR);
LOCATE RO - VSPACING%, HKOL
VERT = IND - 1
ELSE
LOCATE ROW% + VSPACING% * (VN - 1), HKOL
PRINT VAR$(VN, HOR);
LOCATE ROW% + VSPACING% * (VN - 1), HKOL
VERT = VN
END IF
GOSUB HELPH
END IF
IF L = 1 AND IA = 13 THEN ' ENTER KEY
IND = 0
DO
IND = IND + 1
LOOP UNTIL POS(0) = COLPOS(IND)
HMENU% = IND
VMENU% = VERT
COLOR FG%, BG%
EXIT SUB
END IF
IF L = 1 AND IA = 27 THEN ' Esc KEY
HMENU% = 0
VMENU% = 0
COLOR FG%, BG%
EXIT SUB
END IF
IF L = 1 THEN ' MATCH SINGLE KEY WITH FIRST LETTER OF SOME ITEM